import Mock from "mockjs";

let data = Mock.mock({
	"data|100": [
		{
			"name|+1": 1,
			age: "@ineger(0,100)",
			sex: "1"
		}
	]
});
//模拟-获取菜单列表
Mock.mock(/\/api\/getUserList/, "get");

function formatParams(url) {
	const index = url.indexOf("?");
	let query = {};
	if (index !== -1) {
		const queryStrArr = url.substr(index + 1).split("&");
		for (var i = 0; i < queryStrArr.length; i++) {
			const itemArr = queryStrArr[i].split("=");
			query[itemArr[0]] = itemArr[1];
		}
	}
	return query;
}
